#ifndef MYCBIR_COREH
#define MYCBIR_COREH
#include "myCBIR_Tools.h"
#include "cv.h"
#include "highgui.h"
#include <boost/shared_ptr.hpp>
#include <boost/thread/thread.hpp>
#include "myCBIR_FrameCapture.h"
#include "myCBIR_VideoOutputWidget.h"
#include "myCBIR_FaceDetector.h"

namespace myCBIR
{
    struct Image
    {
        IplImage* image;
        string filename;
    };

    class FaceDetector;

    class Core
    {
        public:
            Core(const string &windowName);
            ~Core();

            void loadImages(const string &directory, const string &type);
            void showImage(IplImage *);
            void waitPlease(){cvWaitKey(0);};
            void computeStdDevOfImages();
            void loadObjectforrecognize(const string &object);
            void openWebcamVideoCapture();
            void closeWebcamVideoCapture();
            void startCapturingVideo();
            void testLoop();

        private:
            void addImage(const string &name);
            

        private:
            cv::CascadeClassifier classifier;
            Tools* tools;
            vector<Image> vImages;
            CvCapture* pCapture;

            string sWindowName;

            boost::thread frameCaptureThread;

            boost::shared_ptr<FrameCapture> frameCapture;
            //FrameCapture* frameCapture;
            VideoOutputWidget *pOutputWidget;

            boost::shared_ptr<FaceDetector> faceDetector;
    };
}

#endif